import 'package:app/shared/constants/common.dart';
import 'package:app/routes/my_pages.dart';
import 'package:flutter/material.dart';
import 'package:get/route_manager.dart';
import 'package:flutter/services.dart';
import 'di.dart';
import 'app_binding.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  //顶部状态栏透明
  SystemChrome.setSystemUIOverlayStyle(
      SystemUiOverlayStyle(statusBarColor: Colors.transparent));
  SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual,
      overlays: [SystemUiOverlay.bottom, SystemUiOverlay.top]);
  await DenpendencyInjection.init();
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return GetMaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Smile',
      initialRoute: AppPages.INITIAL,
      initialBinding: AppBinding(),
      defaultTransition: Transition.fade,
      smartManagement: SmartManagement.keepFactory,
      getPages: AppPages.routes,
      theme: ThemeData(
          primaryColor: sPrimaryColor,
          textTheme: Theme.of(context).textTheme.apply(bodyColor: sTextColor)),
    );
  }
}
